function Person(labelValueObj:{label:string,key?:number}){
    console.log(labelValueObj.label)
}
let myObj  = {label:'1223213',key:123}
Person(myObj)
// 接口
interface labelledValue {
    label:string,
    readonly  key?:number
}
function Person1(labelValueObj:labelledValue){
    console.log(labelValueObj.label)
}
let p1 = Person1(myObj)
let p2:labelledValue ={label:'123',key:1231}
//无法改变因为key是可读属性
p2.key = 23112
p2.label = '23112'
//ReadonlyArray 将数组变成只读数组 
let a:number[] = [1,2,3,4,5]
// let a1: ReadonlyArray<number> = a
// a1[0] = 123

interface myReadonlyArr<T> {
    readonly [n:number]:T
}
let a2:myReadonlyArr<number> = a
let a3:readonly number[] = [1,2.3,2]
a2[0] = 1
a3[0] = 1

type IsString<T> = T extends string ? true : false;
type I0 = IsString<number>; // false
type I1 = IsString<"abc">;  // true
type I2 = IsString<any>;    // boolean
type I3 = IsString<never>;  // never
type I4 = IsString<string | true>;
type test = never extends string ? true : false

type T3 =  string | number | symbol | boolean | never